package tr.com.netgis;

import java.text.MessageFormat;

import tr.com.netgis.pojo.Message;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class MessageViewActivity extends Activity {

	private Message message;
	private TextView messageText;
	private TextView timeText;
	private TextView headerText;
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.message_view);
		this.messageText = (TextView)findViewById(R.id.txtMessageText);
		this.headerText = (TextView)findViewById(R.id.ng_message_view_txtheader);
		this.timeText = (TextView)findViewById(R.id.ng_message_view_txttime);
	}
	
	
	

	@Override
	protected void onResume() {
		super.onResume();
		message = MessagesListActivity.SELECTED_MESSAGE;
		messageText.setText(MessageFormat.format("Gönderen: {0}\nMesaj:\n{1}\n\n---\n{2}", 
				message.getSender(),
				message.getMessageBody(),
				message.toString())); //TODO test için koyuldu
		
		
		headerText.setText(message.getMessageHeader());
		timeText.setText(message.getTime());
	}
	
	
}
